package dynamic;

public class SingleLinkedListTest3 {

	public static void main(String[] args) {
		Node node0 = node(1, node(20, node(2, node(3, null))));

		Node ref = node0;
/*		while (ref != null) {
			System.out.print(" " + ref.value);
			ref = ref.next;
		}
*/	
		
		//System.out.println(" " + ref.value);
		
/*		int listLen = SingleLLUtils_1.length(ref);
		System.out.println("Lenght of list is equal "+listLen + "elements");
		
		int max = SingleLLUtils_1.max(ref);
		System.out.println("Max value of list is equal "+max);
		
		int sum = SingleLLUtils_1.sum(ref);
		System.out.println("Sum of list is equal "+ sum);
*/
						
		SingleLLUtils_2.add(ref, 40);
		printList(ref);
				
		SingleLLUtils_2.remove(ref);
		System.out.println();
		printList(ref);
		
		System.out.println();
		ref = SingleLLUtils_2.add(ref, 100, 85);
		printList(ref);
	}

	
	private static void printList (Node ref){
		while (ref != null) {
			System.out.print(" " + ref.value);
			ref = ref.next;
		}
	}
	
	public static Node node(int value, Node next) {
		return new Node(value, next);
	}

}
